<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div></div>
    <script>
        var div  = document.querySelector('div')
        var i = 5;
        setInterval(function(){
            if(i==0){
                
                Location.href = 'https://www.baidu.com/'
            }
            div.innerHTML = '将在'+i+'秒后跳转'
            i--;
        },1000
        )
    </script>
</body>
</html>